/* FoxGUI - The fast, flexible, free Amiga GUI system
Copyright (C) 2001 Simon Fox (Foxysoft)
This library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 2.1 of the License, or (at your option) any later version.This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
PushButton *MakeFileButton(GuiWindow *Wptr, char *name, int left, int top, int width, int height, int key, struct Border *cb, int (*callfn) (char*, char*))
void FOXLIB SetFrameDragPointer(REGA0 Frame *Fptr, REGA1 unsigned short *DragPointer, REGD0 int width, REGD1 int height, REGD2 int xoffset, REGD3 int yoffset)
{
Fptr->DragPointer = DragPointer;
Fptr->PointerWidth = width;
Fptr->PointerHeight = height;
Fptr->PointerXOffset = xoffset;
Fptr->PointerYOffset = yoffset;
}
Frame* FOXLIB MakeFrame(REGA0 void *Parent, REGA1 char *name, REGD0 int left, REGD1 int top, REGD2 int width, REGD3 int height, REGA2 struct Border *cb, REGA3 int (* __far __stdargs callfn) (Frame*, short, short, short, void**), REGD4 short flags, REGD5 void *extension)
{
Frame *Fptr;
GuiWindow *Wptr;
Frame *ParentFrame = NULL;
Diagnostic("MakeFrame", ENTER, TRUE);
if (!Parent)
{
Diagnostic("MakeFrame", EXIT, FALSE);
return NULL;
}
if ((Fptr = (Frame *) GuiMalloc(sizeof(Frame), 0)) == NULL)
{
Diagnostic("MakeFrame", EXIT, FALSE);
return NULL;
}
if ((Fptr->WidgetData = (Widget *) GuiMalloc(sizeof(Widget), 0)) == NULL)
if (tc->FirstTab && tc->FirstTab->frame && (GuiWindow *) tc->FirstTab->frame->button.UserData == win)
{
DestroyTabControl(tc, refresh);
/* There could be tab controls within tab controls so it's not safe to assume that the next one
in the list stll exists. */
tc = Gui.FirstTabControl;
}
else
tc = tc->next;
}
Diagnostic("DestroyWinTabControls", EXIT, TRUE);
}
void DestroyAllTabControls(BOOL refresh)
{
TabControl *tc = Gui.FirstTabControl;
Diagnostic("DestroyAllTabControls", ENTER, TRUE);
while (tc)
{
DestroyTabControl(tc, refresh);
/* There could be tab controls within tab controls so it's not safe to assume that the next one
in the list stll exists. */
tc = Gui.FirstTabControl;
}
Diagnostic("DestroyAllTabControls", EXIT, TRUE);
}
/* Returns a pointer to Frame frameno in the TabControl tc, or NULL if tc is NULL or if frameno is too
high. Note that frames are numbered starting at zero. */
Frame* FOXLIB TabControlFrame(REGA0 TabControl *tc, REGD0 int frameno)
{
Tab *t;
int n = 0;
if (!tc)
return NULL;
t = tc->FirstTab;
while (n < frameno && t)
{
t = t->next;
n++;
}
if (t)
return t->frame;
else
return NULL;
}
BOOL SetUpTab(TabControl *tc, Tab *t, void *Parent, int left, int top, int width, int height, int tableft, int tabheight, int tabwidth, char *caption, short flags, struct Border *customborder, BOOL hidden, int (* __far __stdargs framefn) (Frame*, short, short, short, void**))
{
/* Make the button before the frame. Ideally all of the buttons should be made before all of the
frames because that's the order they end up in once any button has been pressed (because hiding
a frame removes it from the gadget list and showing a frame adds it to the end). */
if ((t->pb = MakeFrame(Parent, caption, tableft, top, tabwidth, tabheight, NULL,